<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title> {$action} | {:get_opinion('title')}</title>

    <include file="Public:head"/>

</head>
<body class="skin-blue">

{:W('Common/header')}

<div class="wrapper row-offcanvas row-offcanvas-left">
    {:W('Common/sideMenu')}


    <!-- Right side column. Contains the navbar and content of the page -->
    <aside class="right-side">
        <!-- Content Header (Page header) -->


        <section class="content-header">
            <h1>
                {$action}
                <small>{$Think.config.title}</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="{$module_url}"><i class="fa fa-dashboard"></i> {$module}</a></li>
                <li class="active">{$action}</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">

            <div class="row">
                <div class="col-md-12">
                    <div class="box box-warning">
                        <div class="box-header">
                            <h3 class="box-title">{$action}</h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">


                            <h4>数据库中共有{$tables}张表，共计{$total}</h4>
                            <!-- BEGIN EXAMPLE TABLE PORTLET-->
                            <form method="post" action="{$formUrl}">
                                <table
                                        class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <th style="width: 8px;">选择</th>
                                        <th>表名</th>
                                        <th class="hidden-240">表用途</th>
                                        <th class="hidden-480">记录行数</th>
                                        <th class="">引擎类型</th>
                                        <th class="">字符集</th>
                                        <th class="">表大小</th>
                                    </tr>
                                    </thead>
                                    <tbody id="cache_table">
                                    <volist name="list" id="tab">
                                        <tr align="center">
                                            <td><input type="checkbox" class='groupclass' name="table[]"
                                                       value="{$tab.Name}"/>
                                            </td>
                                            <td align="left">{$tab.Name}</td>
                                            <td>{$tab.Comment}</td>
                                            <td>{$tab.Rows}</td>
                                            <td>{$tab.Engine}</td>
                                            <td>{$tab.Collation}</td>
                                            <td>{$tab.size}</td>
                                        </tr>
                                    </volist>
                                    </tbody>
                                    <tfoot>
                                    <tr>
                                        <th></th>
                                        <th></th>
                                        <th></th>
                                        <th></th>
                                        <th></th>
                                        <th></th>
                                        <th></th>
                                    </tr>
                                    </tfoot>
                                </table>
                                <div class="row inline" style="text-align: center">
                                    <button type="submit" class="btn btn-success"> 开始备份</button>

                                    <button type="button" class="btn btn-primary" id="checkall"> 全选</button>

                                    <button type="button" class="btn btn-danger" id="check_cancel"> 取消</button>

                                 </div>


                            </form>


                        </div>
                    </div>
                </div>
            </div>


        </section>
        <!-- /.content -->
    </aside>
    <!-- /.right-side -->
</div>
<!-- ./wrapper -->

<include file="Public:foot"/>
<script>
    jQuery(document).ready(function () {
        $("#cache_table :checkbox").attr("checked", true);
        $("div").addClass("checked");


        $("#checkall").click(function () { //":checked"匹配所有的复选框
            $("#cache_table :checkbox").attr("checked", true); //"#div1 :checked"之间必须有空格checked是设置选中状态。如果为true则是选中fo否则false为不选中
            $(".icheckbox_minimal").addClass("checked");


        });
        $("#check_cancel").click(function () {
            $("#cache_table :checkbox").attr("checked", false);
            $(".icheckbox_minimal").removeClass("checked");
//            $("div").removeClass("checked");


        });
//        //理解用迭代原理each（function(){}）
        $("#check_reverse").click(function () {
            $("#cache_table :checkbox").each(function () {


                $(this).attr("checked", !$(this).attr("checked"));
                $(this).parent('div').removeClass("checked", !$(this).attr("checked"));

                //!$(this).attr("checked")判断复选框的状态：如果选中则取反
            });
        });
    });
</script>
</body>
</html>